package it.polimi.traveldream.web.beans;

import java.util.List;

import it.polimi.traveldream.ejb.management.PPrenotatiDTO;
import it.polimi.traveldream.ejb.management.UserDTO;
import it.polimi.traveldream.ejb.management.UserMgr;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

@ManagedBean(name = "userBean")
@RequestScoped
public class BeanUtente {
	
	@EJB
	private UserMgr userMgr;
	
	public String getName() {
		return userMgr.getUserDTO().getFirstName();
	}
	
	public String getSurname() {
		return userMgr.getUserDTO().getLastName();
	}
	
	public String getEmail() {
		return userMgr.getUserDTO().getEmail();
	}
	
	public String getPassword(){
		return userMgr.getUserDTO().getPassword();
	}
	
	public UserDTO getUserBean() {
		return userMgr.getUserDTO();
	}
	
	public List<PPrenotatiDTO> getPacchettiPrenotati() {
		return userMgr.getPrenotazioni();
	}
	
	public String rimuoviUtente() {
		userMgr.unregister();
		return "";
	}
}
